package com.example.server.util;

import com.example.server.bean.Admin;
import org.springframework.security.core.context.SecurityContextHolder;

/**
 * ProjectName: yeb
 * Author: 别怿言
 * Date: 2023-02-08 17:14
 * Description：获取当前登录管理员信息
 */
public class CurrentAdmin {

    public static Admin getCurrentAdmin(){
        return (Admin)SecurityContextHolder.getContext().getAuthentication().getPrincipal();
    }

}
